﻿#pragma once
/**
@author 何炜
@date 2011/5/24
@brief .
@details
*/
#include "GLLObjCom.h"
#include "GLLSignal.h"

namespace GLL
{
	/**Skeleton Animation.*/
	class OCSkltnAnmtn : public ObjectComponent
	{
		//动画播放
		Check _animChgd;
		Check _propChgd;
		float _rate;
		bool _loop;
		void ApplyAnim();
		void AnimAddTime( TimeMS ms );
		virtual bool Ok2Add(Object*);
		void ApplyChange();
		String _name;

		//骨骼手动修改
		Check _scaleChgd;
		String _bone;
		float _scale;

#ifdef GLL_OGRE
		Ogre::AnimationState* _as;
		Ogre::SkeletonInstance* _skel;
#endif
	public:
		static const String name;
		virtual void Update(TimeMS);
		void ObtainSkel();
		void ChangeBoneScale();
		virtual void ObjectLoaded();

		OCSkltnAnmtn();
		void ScaleBone(const String& bone_name, float scale);
		void SetLoop(bool lup){_loop = lup; _propChgd.Set();}
		void SetAnimation(const String& name){_name = name; _animChgd.Set();}
		void SetTimeRate(float times){_rate = times;}
	};


};//GLL
